package com.oozol.lieluyun.entity;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;

public class ResultData<T> {
   @ApiModelProperty("返回信息")
   private String msg;
   @ApiModelProperty("状态码")
   private int code;
   @JsonSerialize(
      using = ToStringSerializer.class
   )
   @ApiModelProperty("总记录")
   private int count;
   @ApiModelProperty("当前页")
   private int page;
   @ApiModelProperty("返回数据")
   private T data;

   public String getMsg() {
      return this.msg;
   }

   public int getCode() {
      return this.code;
   }

   public int getCount() {
      return this.count;
   }

   public int getPage() {
      return this.page;
   }

   public T getData() {
      return this.data;
   }

   public void setMsg(final String msg) {
      this.msg = msg;
   }

   public void setCode(final int code) {
      this.code = code;
   }

   public void setCount(final int count) {
      this.count = count;
   }

   public void setPage(final int page) {
      this.page = page;
   }

   public void setData(final T data) {
      this.data = data;
   }

   public boolean equals(final Object o) {
      if (o == this) {
         return true;
      } else if (!(o instanceof ResultData)) {
         return false;
      } else {
         ResultData<?> other = (ResultData)o;
         if (!other.canEqual(this)) {
            return false;
         } else {
            Object this$msg = this.getMsg();
            Object other$msg = other.getMsg();
            if (this$msg == null) {
               if (other$msg != null) {
                  return false;
               }
            } else if (!this$msg.equals(other$msg)) {
               return false;
            }

            if (this.getCode() != other.getCode()) {
               return false;
            } else if (this.getCount() != other.getCount()) {
               return false;
            } else if (this.getPage() != other.getPage()) {
               return false;
            } else {
               Object this$data = this.getData();
               Object other$data = other.getData();
               if (this$data == null) {
                  if (other$data != null) {
                     return false;
                  }
               } else if (!this$data.equals(other$data)) {
                  return false;
               }

               return true;
            }
         }
      }
   }

   protected boolean canEqual(final Object other) {
      return other instanceof ResultData;
   }

   public int hashCode() {
      int PRIME = 59;
      int result = 1;
      Object $msg = this.getMsg();
      result = result * 59 + ($msg == null ? 43 : $msg.hashCode());
      result = result * 59 + this.getCode();
      result = result * 59 + this.getCount();
      result = result * 59 + this.getPage();
      Object $data = this.getData();
      result = result * 59 + ($data == null ? 43 : $data.hashCode());
      return result;
   }

   public String toString() {
      return "ResultData(msg=" + this.getMsg() + ", code=" + this.getCode() + ", count=" + this.getCount() + ", page=" + this.getPage() + ", data=" + this.getData() + ")";
   }
}
